Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 5 - Option Management / Option Management Reference
Functions / Manipulating the Format of Option Information


OTCreateOptionString

Creates a string from a buffer containing TOption structures.

C INTERFACE
OTCreateOptionString (const char* prtclName, TOption** optPtr,
                      void* bufEnd, char* string,
                      size_t stringSize);
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
prtclName
A constant specifying the name of the protocol for this option or options.
optPtr
A pointer to a pointer to a buffer containing one or more TOption structures.
bufEnd
A pointer to the first byte of memory past the last option.
string
A pointer to a buffer where the string is to be stored. You must allocate this buffer.
stringSize
The length of the buffer where the string is to be stored. You must specify this value.
DESCRIPTION
You can use the OTCreateOptionString function to parse through the options buffer returned by the ret parameter to the OTOptionMangement function and create a string specifying option values that you can display.

This function is supplied solely as a debugging aid. You should not include the function in a production version of your application because there is no provision made for localizing string information.

SEE ALSO
You obtain the buffer to be converted from the ret parameter to the OTOptionManagement function (page 5-34). Listing 5-3 on page 5-24 shows how you use the OTCreateOptionString function.

You can reverse the procedure and build an options buffer from a string by using the OTCreateOptions function (page 5-38).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996